using System.Data.Common;
using System.Data.Common.CommandTrees;
using EFProviderWrapperToolkit;

namespace EFMetaProvider
{
    internal class EFMetaProviderServices : DbProviderServicesBase
    {
        static EFMetaProviderServices()
        {
            Instance = new EFMetaProviderServices();
        }

		private EFMetaProviderServices()
        {
        }

        public static EFMetaProviderServices Instance { get; private set; }

        protected override string DefaultWrappedProviderName
        {
            get { return EFMetaProviderConfiguration.DefaultWrappedProvider; }
        }

        protected override string ProviderInvariantName
        {
            get { return "EFMetaProvider"; }
        }

        public override DbCommandDefinitionWrapper CreateCommandDefinitionWrapper(DbCommandDefinition wrappedCommandDefinition, DbCommandTree commandTree)
        {
			return new DbCommandDefinitionWrapper(wrappedCommandDefinition, commandTree, (cmd, def) => new EFMetaCommand(cmd, def));
        }
    }
}


